<script setup lang="ts">
const apiUrl = ref(
  "https://api.jihw.top/web-api/member/company-info/companyPage"
);

const { data, error, pending, refresh } = useHttp(apiUrl.value, {
  method: "GET",
  query: {
    page: 1,
    pageSize: 5,
  },
  headers: {
    "x-foo": "bar",
  },
});

function onRefresh() {
  refresh();
}
</script>

<template>
  <div>
    <span v-if="pending">加载中...</span>
    <span v-else-if="data">Todos: {{ data }}</span>
    <span v-else-if="error">错误: {{ error }}</span>
    <button @click="onRefresh">刷新</button>
  </div>
</template>

<style lang="scss" scoped></style>
